<template>
  <div class="box-container">
    <el-table
      :data="goodsList"
      border
      stripe
      style="width: 100%"
    >
      <el-table-column
        type="index"
        label="#"
        width="48"
      />
      <el-table-column
        prop="goods_name"
        label="商品名称"
      />
      <el-table-column
        prop="goods_price"
        label="商品价格(元)"
        width="90"
      />
      <el-table-column
        prop="goods_weight"
        label="商品重量"
        width="70"
      />
      <el-table-column
        label="创建时间"
        width="140"
      >
        <template slot-scope="{row}">
          {{ row.add_time | relativeTime }}
        </template>
      </el-table-column>
      <el-table-column
        label="操作"
        width="120"
      >
        <template slot-scope="{row}">
          <el-button type="primary" size="mini" icon="el-icon-edit" @click="onEdit(row.goods_id)" />
          <el-button type="danger" size="mini" icon="el-icon-delete" @click="onDelete(row.goods_id)" />
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  props: {
    goodsList: {
      type: Array,
      required: true
    }
  },
  data() {
    return {
    }
  },
  created() {
  },
  methods: {
  }
}
</script>

<style scoped lang='scss'>
.el-table{
  margin-top: 15px;
  font-size: 12px;
}
</style>
